using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace vtpsms.dao.Models.Mapping
{
    public class SMS_TABLEMap : EntityTypeConfiguration<SMS_TABLE>
    {
        public SMS_TABLEMap()
        {
            // Primary Key
            this.HasKey(t => t.SmsId);

            // Properties
            this.Property(t => t.SmsContent)
                .IsRequired()
                .HasMaxLength(1000);

            this.Property(t => t.SmsContentNoUnicode)
                .IsRequired()
                .HasMaxLength(1000);

            this.Property(t => t.CreateBy)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("SMS_TABLE");
            this.Property(t => t.SmsId).HasColumnName("SmsId");
            this.Property(t => t.SmsContent).HasColumnName("SmsContent");
            this.Property(t => t.SmsContentNoUnicode).HasColumnName("SmsContentNoUnicode");
            this.Property(t => t.CreateAt).HasColumnName("CreateAt");
            this.Property(t => t.CreateBy).HasColumnName("CreateBy");
            this.Property(t => t.IsActive).HasColumnName("IsActive");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.NumberSuccess).HasColumnName("NumberSuccess");
            this.Property(t => t.NumberFailed).HasColumnName("NumberFailed");
        }
    }
}
